package com.example.sunnyweather.db;

import java.util.Objects;

public class County {
    private Integer id;
    private String countyName;
    //外键约束
    private Integer cityId;
    private String weatherId;

    public County() {
    }

    public County(Integer id, String countyName, Integer cityId, String weatherId) {
        this.id = id;
        this.countyName = countyName;
        this.cityId = cityId;
        this.weatherId = weatherId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCountyName() {
        return countyName;
    }

    public void setCountyName(String countyName) {
        this.countyName = countyName;
    }

    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    public String getWeatherId() {
        return weatherId;
    }

    public void setWeatherId(String weatherId) {
        this.weatherId = weatherId;
    }

    @Override
    public String toString() {
        return "County{" +
                "id=" + id +
                ", countryName='" + countyName + '\'' +
                ", cityId=" + cityId +
                ", weatherId='" + weatherId + '\'' +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getCountyName(), getCityId(), getWeatherId());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof County)) return false;
        County county = (County) o;
        return getId().equals(county.getId()) &&
                getCountyName().equals(county.getCountyName()) &&
                getCityId().equals(county.getCityId()) &&
                getWeatherId().equals(county.getWeatherId());
    }

}
